package com.company.cloud.user.modules.api.service;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.user.modules.api.fallback.RolePlatformRemoteServiceFallbackFactory;
import com.company.cloud.user.modules.api.request.RoleAddRequest;
import com.company.cloud.user.modules.api.request.RoleGet2DelRequest;
import com.company.cloud.user.modules.api.request.RoleQueryRequest;
import com.company.cloud.user.modules.api.request.RoleUpdateRequest;
import com.company.cloud.user.modules.api.response.RoleModel;
import com.company.cloud.user.modules.api.response.UserBaseResp;
import com.company.common.server.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(contextId = "rolePT", name = ServiceNameConstant.user_center, fallbackFactory = RolePlatformRemoteServiceFallbackFactory.class)
public interface RolePlatformRemoteService {

    /**获取平台角色列表*/
    @RequestMapping(value = "/remote/pt/role/list", method = RequestMethod.POST)
    public BaseClientResult<List<RoleModel>> roleList(@RequestBody RoleQueryRequest request);

    /**新增平台角色*/
    @RequestMapping(value = "/remote/pt/role/addRole", method = RequestMethod.POST)
    public BaseClientResult<RoleModel> addRole(@RequestBody RoleAddRequest request);

    /**修改平台角色*/
    @RequestMapping(value = "/remote/pt/role/updateRole", method = RequestMethod.POST)
    public BaseClientResult<RoleModel> updateRole(@RequestBody RoleUpdateRequest request);


    /**获取平台角色*/
    @RequestMapping(value = "/remote/pt/role/infoRole", method = RequestMethod.POST)
    public BaseClientResult<RoleModel> infoRole(@RequestBody RoleGet2DelRequest request );

    /**删除平台角色*/
    @RequestMapping(value = "/remote/pt/role/delRole", method = RequestMethod.POST)
    public BaseClientResult<String> delRole(@RequestBody RoleGet2DelRequest request );

    /**重新加载公司角色权限缓存*/
    @RequestMapping(value = "/remote/pt/role/reloadCompanyAuth", method = RequestMethod.GET)
    public BaseClientResult<String> reloadCompanyAuth(@RequestParam("companyNo") String companyNo);
}
